<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			* {
				padding: 0;
				margin: 0 auto;
			}
			
			body {
				font-family: "微软雅黑";
				background-color: #F9F9F9;
			}
			
			.main {
				width: 854px;
				height: 609px;
				margin: auto;
				margin-top: 40px;
				background-color: white;
			}
			
			.mi {
				width: 786px;
				height: 88px;
				/*border: 1px solid;*/
				text-align: center;
			}
			
			.zi {
				width: 786px;
				height: 45px;
				/*border: 1px solid;*/
				text-align: center;
				font-size: 30px;
			}
			
			.zi h4 {
				font-family: "微软雅黑";
			}
			
			.ll {
				width: 332px;
				height: 436px;
				/*border: 1px solid;*/
			}
			
			.mm {
				width: 332px;
				height: 376px;
				margin-top: 30px;
				/*border: 1px solid;*/
				font-size: 15px;
			}
			
			.zhongguo {
				width: 332px;
				height: 42px;
				margin-top: 10px;
				border: 1px solid #E8E8E8;
				position: relative;
				font-size: 14px;
				cursor: pointer;
			}
			
			.zhongguo span {
				display: inline;
				float: left;
				width: 277px;
				cursor: pointer;
				padding-left: 10px;
				font-size: 14px;
				line-height: 40px;
			}
			
			.cheng {
				width: 332px;
				height: 40px;
				margin-top: 10px;
				
				/*border: 1px solid;*/
			}
			
			
			
			
			.yan {
				width: 332px;
				height: 42px;
				margin-top: 10px;
				
			}
			.yan  img{
				vertical-align: middle;
			}
			.yan input{
				width: 170px;
				height: 20px;
				padding: 10px;
				border: 1px solid #E8E8E8;
				outline-style: none;
			}
			.chengse {
				width: 332px;
				height: 42px;
				margin-top: 30px;
				text-align: center;
				background-color: #ff6700;
				/*border: 1px solid;*/
				color: white;
				line-height: 40px;
				cursor: pointer;
			}
			.chengse:hover {
				background-color: #ff936a;
				
			}
			.zhu {
				font-size: 14px;
				color: #9D9D9D;
				margin-top: 10px;
				
			}
			
			.zhu a {
				text-decoration: none;
				color: black;
				font-weight: bold;
			}
			
			.zgcho {
				width: 332px;
				height: 250px;
				overflow: auto;
				border: 1px solid #E8E8E8;
				position: absolute;
				left: 0;
				top: 41px;
				background-color: white;
				display: none;
				z-index: 100;
			}
			
			.zgcho .zg-1 {
				width: 293px;
				height: 34px;
				padding: 10px;
			}
			
			.zgcho .zg-1 input {
				width: 274px;
				height: 34px;
				border: 1px solid #e0e0e0;
			}
			
			.zgcho .code {
				width: 313px;
				height: 10816px;
			}
			.zgcho .code .chead {
				background-color: #fcdecc;
      padding-left: 10px;
      margin-bottom: 6px;
      line-height: 30px;
       color: #ef5b00 ;
	  		}
			.zgcho .code li{
				padding: 0 10px;
    line-height: 39px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
	  		}
			.zgcho .code li:hover{
				background-color: #eaeaea;
	  		}
	  		.jia86 {
				margin-top: 10px;
	  			
				width: 332px;
				height: 42px;
				border: 1px solid #E8E8E8;
				margin-bottom: 20px;
            position: relative;
			}
			.jia86 .aa {
				width: 64px;
				line-height: 40px;
				height: 42px;
                 float: left;
                 border-right: 1px solid #E8E8E8;
                 padding-left: 10px;
                 cursor: pointer;
			}
			.jia86 .aa img{
			vertical-align: middle;}
			.jia86  input{
				width: 244px;
				height: 42px;
				border: none;
				outline-style: none;
				padding-left: 10px;}
		   .phone {
				width: 332px;
				height: 250px;
				overflow: auto;
				border: 1px solid #E8E8E8;
				position: absolute;
				left: 0;
				top: 41px;
				background-color: white;
				display: none;
			}
			
			.phone .zg-1 {
				width: 293px;
				height: 34px;
				padding: 10px;
			}
			
			.phone .zg-1 input {
				width: 274px;
				height: 34px;
				border: 1px solid #e0e0e0;
			}
			
			.phone .code {
				width: 313px;
				height: 10816px;
			}
			.phone .code .chead {
				background-color: #fcdecc;
      padding-left: 10px;
      margin-bottom: 6px;
      line-height: 30px;
       color: #ef5b00 ;
	  		}
			.phone .code li{
				padding: 0 10px;
    line-height: 39px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
	  		}
			.phone .code li:hover{
				background-color: #eaeaea;
	  		}
			.phone .code li span{
				float: right;
				color: #9d9d9d;
			}
			.red1{
				font-size: 14px;
              color: #ff6700;
              position: absolute;
              top: 45px;
              font-weight: bold;
              display: none;
              
			}
			.red2{
				font-size: 14px;
              color: #ff6700;
              position: absolute;
              font-weight: bold;
              top: 45px;
              display: none;
			}
			.red3{
				font-size: 14px;
              color: #ff6700;
              font-weight: bold;
              display: none;
              
			}
		</style>
	</head>

	<body>
		<div class="main">
			<div class="mi">
				<img src="img/milogo.png" />
			</div>
			<div class="zi">
				<p>注册小米账号</p>
			</div>
			<div class="ll">
				<div class="mm">
					<p>国家/地区</p>
					<div class="zhongguo">
						<span>中国</span>
						<img src="img/zhuce.png" />
						<div class="zgcho">
							<div class="zg-1">
								<input type="text" name="" id="" value="" />
							</div>
							<div class="code">
                                  <div class="chead">
                                  	常用
                                  </div>
                                  <ul>
                                  	<li>中国</li>
                                  	<li>中国台湾</li>
                                  	<li>中国香港</li>
                                  	<li>Brazil</li>
                                  	<li>India</li>
                                  	<li>Indonesia</li>
                                  	<li>Malaysia</li>
                                  	<li>中国</li>
                                  	<li>中国台湾</li>
                                  	<li>中国香港</li>
                                  	<li>Brazil</li>
                                  	<li>India</li>
                                  	<li>Indonesia</li>
                                  	<li>Malaysia</li>
                                  	<li>中国</li>
                                  	<li>中国台湾</li>
                                  	<li>中国香港</li>
                                  	<li>Brazil</li>
                                  	<li>India</li>
                                  	<li>Indonesia</li>
                                  	<li>Malaysia</li>
                                  	<li>中国</li>
                                  	<li>中国台湾</li>
                                  	<li>中国香港</li>
                                  	<li>Brazil</li>
                                  	<li>India</li>
                                  	<li>Indonesia</li>
                                  	<li>Malaysia</li>
                                  	<li>中国</li>
                                  	<li>中国台湾</li>
                                  	<li>中国香港</li>
                                  	<li>Brazil</li>
                                  	<li>India</li>
                                  	<li>Indonesia</li>
                                  	<li>Malaysia</li>
                                  </ul>
								</div>
						</div>
					</div>

					<div class="cheng">
						成功注册帐号后，国家/地区将不能被修改
					</div>
					<p>手机号码</p>
					<div class="jia86">
						<div class="aa">
                       <span> +86 </span> <img src="img/jia86.png"/>
						</div>
                         <input type="text" placeholder="请输入手机号码"/>
                         <span class="red1">！请输入手机号</span>
                         <span class="red2">！手机号码格式错误</span>
                         
                         <div class="phone">
							<div class="zg-1">
								<input type="text" name="" id="" value="" />
							</div>
							<div class="code">
                                  <div class="chead">
                                  	常用
                                  </div>
                                  <ul>
                                  	<li>中国 <span>+86</span></li>
                                  	<li>中国台湾<span>+886</span></li>
                                  	<li>中国香港<span>+852</span></li>
                                  	<li>Brazil<span>+55</span></li>
                                  	<li>India<span>+92</span></li>
                                  	<li>Indonesia<span>+61</span></li>
                                  	<li>Malaysia<span>+60</span></li>
                                  	
                                  </ul>
								</div>
						</div>
					</div>
					<p>图形验证码</p>
					<div class="yan">
					<input type="text" placeholder="图片验证码"/>
					<img src="img/yanzhengm.png"/>

					</div>
                         <span class="red3" >！请输入图片验证码</span>
					
					<div class="chengse">
						立即注册
					</div>
					<p class="zhu">注册帐号即表示您同意并愿意遵守小米
						<a href="">用户协议</a>和
						<a href="">隐私政策</a>
					</p>
				</div>

			</div>
		</div>
		<script type="text/javascript">
		var kuang=document.querySelector(".zhongguo");
		var choose=document.querySelector(".zgcho");

		kuang.children[1].onclick=function(){
			choose.style.display="block";
		}
		
		var lis=document.querySelectorAll(".zgcho .code li");
		for (var i = 0; i < lis.length; i++) {
			lis[i].onclick=function(){
			kuang.children[0].innerHTML=this.innerHTML;
			choose.style.display="none";
				
			}
		}
		
		
		
		var aa=document.querySelector(".aa");
		var phone=document.querySelector(".phone");

		aa.onclick=function(){
			phone.style.display="block";
		}
		
		var liss=document.querySelectorAll(".phone .code li");
		
		for (var i = 0; i < liss.length; i++) {
			liss[i].onclick=function(){
			aa.children[0].innerHTML=this.children[0].innerHTML;
			phone.style.display="none";
				
			}
		}
		var jia=document.querySelector(".jia86");
		var num=jia.children[1]
		var reg1=/^1[3|4|5|8][0-9]\d{4,8}$/
				 	
	
		num.onblur=function(){
			if (!(reg1.test(num.value))) {
				jia.children[3].style.display="inline-block";
			}else if(num.value==""){
				jia.children[2].style.display="inline-block";
			}else
			{
				jia.children[2].style.display="none";
				jia.children[3].style.display="none";
				
			}
		}
		var input=document.querySelector(".yan input");
		var red=document.querySelector(".red3");
		input.onblur=function(){		
		if(input.value==""){
			red.style.display="inline-block";
		}else{
			red.style.display="none";
			
		}
		}
		</script>
	</body>

</html>